package com.zq.dao;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class BaseDao_zq {
	@Autowired
	SessionFactory sessionFactory = null;
	Session session = null;
	public Session getSession()
	{
		//框架整合的时候尽量使用getCurrentSession 目的是方便事务的处理
		session = sessionFactory.openSession();
		System.out.println(session);
		return session;
	}
	
	
	

}
